package qst.com.bacK.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import qst.com.bacK.pojo.entity.AssessmentType;

import java.util.List;

/**
 * Author:   msh
 * Date:     2024/10/10 上午10:52
 * Description:
 */
public interface AssessmentsMapper {
    @Select("select * from assessments where id = #{assessmentId}")
    AssessmentType findById(int assessmentId);

    @Select("select * from assessments")
    List<AssessmentType> findAll();

    @Select("select * from assessments where title = #{title}")
    AssessmentType findByTitle(String title);

    @Insert("insert into assessments(title,cost,status) values(#{title},#{cost},#{status})")
    void insert(AssessmentType sj);

    @Update("update assessments set title = #{title},cost = #{cost},status = #{status} where id = #{id}")
    void update(AssessmentType sj);

    @Update("delete from assessments where id = #{id}")
    void deleteById(int id);
}
